package test;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import test.xml.TestXMLBean;
import test.xml.XMLBean;
import yns.xml.XmlJaxbUtility;



public class testXmlUtility {
	public static void main(String[] args) {
		XMLBean xmlBean = new XMLBean();

		xmlBean.setAgentid("agentid");
		xmlBean.setMsgtype("msgtype");
		xmlBean.setSafe("safe");
		xmlBean.setText("text");
		xmlBean.setAttribute2("att");

		List<String> touser = new ArrayList<String>();
		touser.add("1");
		touser.add("2");
		touser.add("3");
		touser.add("4");

		List<String> toparty = new ArrayList<>();
		toparty.add("1");
		toparty.add("2");
		toparty.add("3");
		toparty.add("4");

		List<String> totag = new ArrayList<>();
		totag.add("1");
		totag.add("2");
		totag.add("3");
		totag.add("4");

		xmlBean.setToparty(toparty);
		xmlBean.setTotag(totag);
		xmlBean.setTouser(touser);

		TestXMLBean testXMLBean = new TestXMLBean();
		testXMLBean.setId(1);
		testXMLBean.setName("name");
		testXMLBean.setAttribute("attribute");
		testXMLBean.setXmlBean(xmlBean);
		testXMLBean.setTime(LocalDateTime.now());

		List<XMLBean> xmlBeanList = new ArrayList<XMLBean>();
		xmlBeanList.add(xmlBean);
		xmlBeanList.add(xmlBean);
		testXMLBean.setXmlBeanList(xmlBeanList);

		System.out.println(XmlJaxbUtility.convertToXml(testXMLBean));
		
	}
}
